﻿@{
    ViewBag.Title = "采购明细";
    Layout = "~/Views/Shared/_LayoutList.cshtml";
}
@(Html.nbGridFor<MaterialPurchaseItem>(s =>
{
    s.ShowCheckBox(false);
    s.SummaryTemplate("订购数：<b>${OrderCount}</b> 斤，入库数：<b>${StorageCount}</b> 斤，金额：<b>${Amount}</b> 元");
    s.layoutH(120);
    s.Action("List");
    s.Columns(c =>
    {
        c.Bind(m => m.MaterialId).IsKey();
        c.BindDateTime(m => m.Date).Width(80);
        c.BindEnum(m => m.SupplierId, "Supplier").Width(80);
        c.BindEnum(m => m.Category, "MaterialCategory").Width(80);
        c.Bind(m => m.Code).Width(100).Align(GridAlign.Left).AsQuery().AsSearch();
        c.Bind(m => m.Name).Width(100).Align(GridAlign.Left).AsQuery().AsSearch();
        c.Bind(m => m.Price).Width(70).Align(GridAlign.Right).AsSearch(SearchControlType.NumberBlock);
        c.BindEnum(m => m.Unit, "MaterialUnit").Width(60);
        c.Bind(m => m.OrderCount).Width(70).Align(GridAlign.Right).Summary(SummaryType.Sum).AsSearch(SearchControlType.NumberBlock);
        c.Bind(m => m.Amount).Width(70).Align(GridAlign.Right).Summary(SummaryType.Sum).AsSearch(SearchControlType.NumberBlock);
        c.Bind(m => m.StorageCount).Width(70).Align(GridAlign.Right).Summary(SummaryType.Sum).AsSearch(SearchControlType.NumberBlock);
        c.BindEnum(m => m.State, "PurchaseState").Width(60).AsSearch();
    });
}))
